from django.conf.urls import url
from django.contrib import admin

from apps.users import views

urlpatterns = [
    url(r'^register/$', views.Register.as_view(),name='register'),
    url(r'^usernames/(?P<username>[a-zA-Z0-9_-]{5,20})/count/$', views.UsernameView.as_view()),
    url(r'^mobile/(?P<mobile>1[3-9]\d{9})/count/$', views.MobileView.as_view()),
    url(r'^login/$', views.LoginView.as_view(),name='login'),
    url(r'^logout/$', views.LogoutView.as_view(),name='logout'),
    url(r'^center/$', views.UsercenterView.as_view(), name='center'),
    url(r'^emails/$', views.EmailView.as_view(), name='emails'),
    url(r'^email_active/$', views.EmailactiveVIew.as_view(), name='email_token'),
    url(r'^address/$', views.UserAddressView.as_view(), name='address'),
    url(r'^addresses/create/$', views.CreateAddressView.as_view(), name='createaddress'),
    url(r'^addresses/(?P<address_id>\d+)/$', views.UpdateAdderssView.as_view(), name='updateaddress'),
    url(r'^addresses/(?P<address_id>\d+)/default/$', views.SetDefaultView.as_view(), name='defaultaddress'),
    url(r'^addresses/(?P<address_id>\d+)/title/$', views.UpdateTitleView.as_view(), name='addresstitle'),
    url(r'^pass/$', views.ChangePasswordView.as_view(), name='changepwd'),
    url(r'^browse_histories/$', views.HistoryView.as_view(), name='history'),

]